#/*HEADER*******************************************************************
#***************************************************************************
#***
#***     Copyright (c) 2002 Sandbridge Technologies, Inc.
#***
#***                     All rights reserved
#***
#*** This software embodies materials and concepts which are confidential
#*** to Sandbridge Technologies, Inc. and is made available
#*** solely pursuant to the terms of a written license agreement with
#*** Sandbridge Technologies, Inc.
#***************************************************************************
#*END*************************************************************************/

# To activate files I/O for validation of UL vs. MatLab must '#define UL_VALIDATION'

BUILD_DIR = .

SRC_DIR_MAC = $(BUILD_DIR)/Source_files
HEAD_DIR_MAC = $(BUILD_DIR)/Header_files

INCLS	= -I$(HEAD_DIR_MAC) \
		-I../Common_Header_files \
		-I../PHY/Common_Phy_Header_files 

MACSRCS =wlan_phy_mac.c  protocal_engine.c  dpram_main.c  isr.c create_macthreads.c wlan_phy_uart.c timer.c\
		appl_to_mac.c cntrl_ap_main.c 

CSRCS = $(MACSRCS)

		
RM	= rm -f
EXT	= .a
PROGRAM	= wlan_mac${EXT}

OBJS 	= $(CSRCS:.c=.o)

CC	= "$(SBROOT)/bin/sbcc"
AS	= "$(SBROOT)/bin/sbcc"
AR	= "$(SBROOT)/bin/sb-ar"

ARCH_FLAGS =--march=sb3500

CFLAGS= $(INCLS) \
	$(ARCH_FLAGS) \
	$(BOARD_FLAGS) \
	-O3  \
	--inline \
	--restrict \
	--noclean 

default:	$(PROGRAM)

all:	$(PROGRAM)

$(PROGRAM): $(OBJS)
	$(AR) rf $@ $^

%.o:	$(SRC_DIR_MAC)/%.c
	$(CC) -o $@ -c $(CFLAGS) $^

clean:
	$(RM) $(OBJS) $(PROGRAM) *.stackdump *~
	$(RM) *.s *.v *.o *.sbx *.nm *.dis
	$(RM) filteredOut.txt iqout.txt testout.txt

clobber: clean
	$(RM) profile.*
